package cn.attackme.myuploader.service.impl;
import cn.attackme.myuploader.service.FileUploadService;
import cn.attackme.myuploader.utils.QCloudCosUtils;
import com.qcloud.cos.model.ObjectListing;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;

/**
 * @author Farewell is well
 * @date 2019-11-20 16:18
 */
@Service
public class FileUploadServiceImpl implements FileUploadService {
    @Autowired
    private QCloudCosUtils qCloudCosUtils;
    @Override
    public String upload(MultipartFile multipartFile) {
        return qCloudCosUtils.upload(multipartFile);
    }

    @Override
    public String upload(File file) {
        return qCloudCosUtils.upload(file);
    }

    @Override
    public ObjectListing getList(String path) {
        return qCloudCosUtils.getList();
    }
}